<template>
  <div class="box">
    <div>
      <SetupScriptComponent ref="setupScriptComponent" v-model="setupForm" />
      <hr />
      <pre>{{ setupForm }}</pre>
    </div>
    <div>
      <NormalScriptComponent ref="normalScriptComponent" v-model="normalForm" />
      <hr />
      <pre>{{ normalForm }}</pre>
    </div>
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue'
import SetupScriptComponent from './components/SetupScriptComponent.vue'
import NormalScriptComponent from './components/NormalScriptComponent.vue'

defineOptions({
  name: 'FamilyPage',
})

const setupScriptComponent = ref(null)
const normalScriptComponent = ref(null)
const setupForm = ref({ name: 'peter' })
const normalForm = ref({ name: 'lily' })

onMounted(() => {
  console.log('setupScriptComponent', setupScriptComponent.value)
  console.log('normalScriptComponent', normalScriptComponent.value)
})
</script>

<style scoped lang="scss">
.box {
  display: flex;
  gap: 20px;

  > div {
    flex: 1;
  }
}

hr {
  margin: 24px 0;
}

pre {
  text-align: left;
  background-color: antiquewhite;
  border-radius: 4px;
  padding: 12px;
}
</style>
